package com.alan.product.issue.content;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class LogTest {

    private static void log(Object o) {
        try {
            log.info("log something, param={}", o.toString());
        } catch (Exception e) {
            log(o, e);
        }
    }

    private static void log(Object o, Exception e) {
        try {
            log.error("something error, param={}", o.toString(), e);
        } catch (Exception ex) {
            log(o, ex);
        }
    }

    static class Point {
        int x;
        int y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return String.valueOf(x / y);
        }
    }

    public static void main(String[] args) {
        Point point = new Point(10, 0);
        log(point);
    }
}
